package xyz.labmem.base.sys.module.auth.controller.request

import io.swagger.annotations.ApiModelProperty
import xyz.labmem.base.core.base.BaseVerify
import javax.validation.constraints.NotBlank
import javax.validation.constraints.Size

/**
 * @Author lty
 * @Date 2021/12/15 17:04
 */
open class AuthRequest {

    @ApiModelProperty(value = "账号")
    @NotBlank(message = "请输入账号", groups = [BaseVerify.put::class])
    @Size(min = 2, max = 20, message = "账号长度在2-20位", groups = [BaseVerify.put::class])
    var account: String? = null

    @ApiModelProperty(value = "密码")
    @NotBlank(message = "请输入密码", groups = [BaseVerify.put::class])
    @Size(min = 6, max = 18, message = "密码长度在6-18位", groups = [BaseVerify.put::class])
    var password: String? = null

}

class AdminAuthRequest : AuthRequest() {

    @ApiModelProperty(value = "验证码")
    @NotBlank(message = "请输入验证码", groups = [BaseVerify.put::class])
    var captcha: String? = null

    @ApiModelProperty(value = "验证码key")
    @NotBlank(message = "请传入验证码key", groups = [BaseVerify.put::class])
    var captchaKey: String? = null

}